<?php
function pre_next_bottom($postid)
{
   $output =  "<div class='nav-below'><div class='nav-previous'>";
   $output .= previous_static_link($postid);
   $output .= "</div><div class='nav-next'>";
   $output .= next_static_link($postid); 
   $output .=  "</div></div>";
   return $output;
}
function previous_static_link($postid)
{
	global $wpdb,$DH_archivers_src_path;
	$archivers_page_r = '';
	$sql_ap = "SELECT *
              FROM $wpdb->posts
              WHERE post_type = 'post'
              AND post_status = 'publish'
              AND post_password = ''
			  and ID < $postid
			  order by ID desc
			  limit 0,1";
    $archivers_page_index = $wpdb->get_results($sql_ap);
	if($archivers_page_index) { 
		foreach ($archivers_page_index as $page) {
            $archivers_page_url = $DH_archivers_path.'p'.$page->ID.'.html';
            $archivers_page_title = $page->post_title;
            $archivers_page_r = '◄ <a href="'.$archivers_page_url.'" title="'.$archivers_page_title.'">'.$archivers_page_title.'</a>';
		}
	}
	 return $archivers_page_r;
}
function next_static_link($postid)
{
	global $wpdb,$DH_archivers_src_path;
	$archivers_page_r = '';
	$sql_ap = "SELECT *
              FROM $wpdb->posts
              WHERE post_type = 'post'
              AND post_status = 'publish'
              AND post_password = ''
			  and ID > $postid
			  order by ID asc
			  limit 0,1";
    $archivers_page_index = $wpdb->get_results($sql_ap);
	if($archivers_page_index) { 
		foreach ($archivers_page_index as $page) {
            $archivers_page_url = $DH_archivers_path.'p'.$page->ID.'.html';
            $archivers_page_title = $page->post_title;
            $archivers_page_r = '<a href="'.$archivers_page_url.'" title="'.$archivers_page_title.'">'.$archivers_page_title.' ►</a>';
		}
	}
	 return $archivers_page_r;
}
?>